<#include "/common/h-ui-base-css.html">
<#include "/common/h-ui-base-js.html">
<#include "/common/validation-js.html">
<script type="text/javascript" src="/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-column-set">
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr class="text-c">
                <th rowspan="2">列名</th>
                <th rowspan="2">字段说明</th>
                <th colspan="4">列设置</th>
                <th rowspan="2">列名</th>
                <th rowspan="2">字段说明</th>
                <th colspan="4">列设置</th>
            </tr>
            <tr class="text-c">
                <th>是否冻结</th>
                <th>是否隐藏</th>
                <th>是否Format</th>
                <th>约束类型</th>
                <th>是否冻结</th>
                <th>是否隐藏</th>
                <th>是否Format</th>
                <th>约束类型</th>
            </tr>
            </thead>
            <tbody>
                <#if code??>
                    ${code!}
                </#if>
            </tbody>
        </table>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">

    $(function(){
        var id = ${entity.id?default(-1)?c};
        $("#form-column-set").validate({
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'post',
                    url: "/column-set-save/"+id ,
                    data :$("form-column-set").serialize(),
                    async:false,
                    success: function(data){
                        layer.msg('添加成功!',{icon:1,time:1000});
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg('error!',{icon:1,time:1000});
                    }
                });
                var index = parent.layer.getFrameIndex(window.name);
                parent.$('#column_table').datagrid('reload');
                parent.layer.close(index);
            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
